const { resolve } = require('path')
const r = url => resolve(__dirname, url)

const ExtractTextPlugin = require('extract')

module.exports = {
    mode: 'development',
    devtool: true,
    output: {
        path: r('./mina'),
        filename: '[name].js'
    },
    resolve: {
        alias: {
            utils: r('../utils/utils')
        }
    },

    module: {
        rules: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                options: {
                    presets: {}
                }
            },
            {
                test: /\.mina$/,
                loader: 'wechat-mina-loader',
                options: {}
            }
        ]
    },
    plugins: [
        extractSass,
        new Copy
    ]
}